﻿// ------------------------------------------------------------------------------
// This partial class was auto-generated for use with the Habanero Architecture.
// This class is generated only once and you can place custom code here.
// ------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Diagnostics;
using <<|=BOPROJECTNAME|>>;
using Habanero.Base;
using Habanero.BO;
using Habanero.BO.ClassDefinition;
using NUnit.Framework;
using Habanero.Testability;

namespace <<|=BOTestProjectName|>>
{
	/// <summary>
	/// Creates sample <<|=CLASSNAME|>> objects.
	/// </summary>
	public partial class TestUtils<<|=CLASSNAME|>>
	{
		//---------------------------------------------------------------------
		// Use this place to add custom test packs for <<|=CLASSNAME|>>
		// and to replace existing test packs in the "Def" part of this
		// partial class (cut the existing method and paste it here - you will
		// need to do this each time you regenerate).
		//---------------------------------------------------------------------

		public static BOTestFactory<<<|=CLASSNAME|>>> GetTestFactory()
		{
			return BOTestFactoryRegistry.Instance.Resolve<<<|=CLASSNAME|>>>();
		}
	}
	
  /*//Uncomment this and create custom code in the UpdateCompulsoryProperties
	// if there is any custom code required to create a valid <<|=CLASSNAME|>>
	public class BOTestFactory<<|=CLASSNAME|>> : BOTestFactory<<<|=CLASSNAME|>>>
	{
		public BOTestFactory<<|=CLASSNAME|>>(<<|=CLASSNAME|>> <<|=#CLASSNAME|>>)
			: base(<<|=#CLASSNAME|>>)
		{
		}

		public BOTestFactory<<|=CLASSNAME|>>()
		{
		}

		public override void UpdateCompulsoryProperties(IBusinessObject businessObject)
		{
			base.UpdateCompulsoryProperties(businessObject);
			//Do Custom Stuff to create a valid object
		}
	}
	
	OR 

	public class BOTestFactory<<|=CLASSNAME|>> : BOTestFactory<<<|=CLASSNAME|>>>
	{

		public BOTestFactory<<|=CLASSNAME|>>(<<|=CLASSNAME|>> <<|=#CLASSNAME|>>)
			: base(<<|=#CLASSNAME|>>)
		{
			this.SetValidValueGenerator(source => source.SomeProp, typeof(SomePropValidValueGenerator));
		}

		public BOTestFactory<<|=CLASSNAME|>>()
		{
		   this.SetValidValueGenerator(source => source.SomeProp, typeof(SomePropValidValueGenerator));
		}

	}

	public class SomePropValidValueGenerator : ValidValueGeneratorName
	{
		private static readonly List<string> _names = new List<string> { "Tender", "Contract", "AdHoc", "Once Off", "Other", "Lead"};

		public SomePropValidValueGenerator(IPropDef propDef)
			: base(propDef, _names)
		{
		}
	}
	
	*/

}